package com.CTAtracker.android.DataBase;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * This class extends SQLiteOpenHelper to handle the connection to the database
 */
public class MySQLiteHelper extends SQLiteOpenHelper {
	
	/**
	 * The name of the database
	 */
	private static final String DATABASE_NAME = "ctatracker.db";
	/**
	 * The version of the database 
	 */
	private static final int DATABASE_VERSION = 1;

	/**
	 * Constructor, instantiate the database with the method super of SQLiteOpenHelper 
	 * @param context
	 */
	public MySQLiteHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}
	
	/**
	 * This method is called this first time we create the database
	 */
	@Override
	public void onCreate(SQLiteDatabase db) {
		MySQLiteHelperLine.createData(db); 
		MySQLiteHelperStation.createData(db);
		MySQLiteHelperFavorite.createData(db);
	}

	/**
	 * This method is called every time we change the version of the database
	 */
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		
	}
}
